Buffer.from('Hello world!', 'binary').toString('base64')
(function () {
"use strict";
var atob = require('atob');
var b64 = "SGVsbG8sIFdvcmxkIQ==";
var bin = atob(b64);
console.log(bin); // "Hello, World!"
}());
console.log(Buffer.from('Hello World!').toString('base64'));